package com.jia.lidao.others.adapter;

import android.content.Context;
import android.widget.ImageView;
import android.widget.TextView;

import com.jia.lidao.R;
import com.jia.lidao.others.enity.Classify;
import com.jia.lidao.utils.DensityUtils;
import com.jia.lidao.utils.ImageUtil;
import com.jia.lidao.utils.ImgLoaderUtil;
import com.squareup.picasso.Picasso;

import butterknife.BindView;

/**
 * Created by 00029935 on 2017/11/29.
 */

public class ClassifyTabAdapter extends QuickAdapter<Classify.CategoriesBean.ChildBean> {
    @BindView(R.id.iv_classify_item)
    ImageView ivClassifyItem;
    @BindView(R.id.tv_classify_item)
    TextView tvClassifyItem;

    private Context context;

    public ClassifyTabAdapter(Context context) {
        this.context = context;
    }

    @Override
    public int getLayoutID(int viewType) {
        return R.layout.view_classify_item;
    }

    @Override
    public void convert(VH holder, Classify.CategoriesBean.ChildBean itemData, int position) {
        ivClassifyItem = holder.getView(R.id.iv_classify_item);
        ImgLoaderUtil.displayImage(itemData.getPic(),ivClassifyItem);
//        Picasso.with(context).load(itemData.getPic()).error(R.drawable.classify_seven).into(ivClassifyItem);
        tvClassifyItem = holder.getView(R.id.tv_classify_item);
        tvClassifyItem.setText(itemData.getName());
    }
}
